- page_title '用户映射', 'FogBugz 导入'
- header_title "项目", root_path
%h3.page-title
  %i.fa.fa-bug
  从 FogBugz 导入项目
%hr

= form_tag create_user_map_import_fogbugz_path, class: 'form-horizontal' do
  %p
    Customize how FogBugz email addresses and usernames are imported into GitLab.
    In the next step, you'll be able to select the projects you want to import.
  %p
    The user map is a mapping of the FogBugz users that participated on your projects to the way their email address and usernames wil be imported into GitLab. You can change this by populating the table below.
  %ul
    %li
      %strong 默认：映射 FogBugz 账号 ID 到完整姓名
      %p
        An empty GitLab User field will add the FogBugz user's full name
        (e.g. "By John Smith") in the description of all issues and comments.
        It will also associate and/or assign these issues and comments with
        the project creator.
    %li
      %strong 映射 FogBugz 账号 ID 到 GitLab 用户
      %p
        Selecting a GitLab user will add a link to the GitLab user in the descriptions
        of issues and comments (e.g. "By <a href="#">@johnsmith</a>"). It will also
        associate and/or assign these issues and comments with the selected user.

  .table-holder
    %table.table
      %thead
        %tr
          %th ID
          %th 名称
          %th 邮箱
          %th GitLab 用户
      %tbody
        - @user_map.each do |id, user|
          %tr
            %td= id
            %td= text_field_tag "users[#{id}][name]", user[:name], class: 'form-control'
            %td= text_field_tag "users[#{id}][email]", user[:email], class: 'form-control'
            %td
              = users_select_tag("users[#{id}][gitlab_user]", class: 'custom-form-control',
                scope: :all, email_user: true, selected: user[:gitlab_user])

  .form-actions
    = submit_tag '继续下一步', class: 'btn btn-create'

:javascript
  new UsersSelect();
